import re

# 正则表达式

text = "yyyyyyxxxxxxhello123xxxxxxxyyyyyy"

# 提出我们需要的hello123

s1 = "hello888 helo 123 hello 888"
# 找出这个里面的所有数字
# 根据模式，从字符串中找目标
r1 = re.findall("\d",s1)
# print(r1)

# 找hello
r2 = re.findall("hello",s1)
# print(r2)

s2 = "yyyyyyyystart:hello,whit,i am ok end xxxxxxxxxxxx"

p2 = "start:.*?end"

r3 = re.findall(p2,s2)
# print(r3)

s2 = """
    yy 
    yy 
    yyyystart:hello,whit,i am ok end xxxxxxxxxx\n
    xx
"""
p2 = "start:.*?end"

# r3 = re.findall(p2,s2)
# 多行查询处理
r3 = re.findall(p2,s2,re.DOTALL)
print(r3)




